import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../../../utils/xh_styles.dart';
import '../../../../utils/xin_he_image.dart';
import 'xin_he_seller_my_profit_logic.dart';

class XinHeSellerMyProfitPage extends StatelessWidget {
  XinHeSellerMyProfitPage({Key? key}) : super(key: key);

  final logic = Get.put(XinHeSellerMyProfitLogic());
  final state = Get.find<XinHeSellerMyProfitLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body:Stack(children: [
        ///背景层
        Column(children: [
          ///header_    bg
          Container(
            height: Get.mediaQuery.padding.top+44+115+27.5,
            decoration: BoxDecoration(
                gradient: LinearGradient(
                    begin: Alignment.topCenter,
                    end: Alignment.bottomCenter,
                    colors: [
                      XinHeColor('#00DDDD'),
                      XinHeColor('#D9FFFF'),
                    ])),
          ),


        ],),

        ///内容层
        Column(
          mainAxisAlignment: MainAxisAlignment.start,
          children: [
            SizedBox(height: Get.mediaQuery.padding.top,),
            ///导航栏
            Container(
              alignment: Alignment.centerLeft,
              height: 44,
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  GestureDetector(
                    onTap: (){
                      Get.back();
                    },
                    child: Container(
                      height: 44,
                      width: 40,
                      color: Colors.transparent,
                      alignment: Alignment.center,
                      child: const XinHeAssetImage(
                        'assets/images/home/app_back_3.png',
                        width: 9.5,
                        height: 17,
                        fit: BoxFit.cover,),
                    ),
                  ),
                  Text('我的收益',style: TextStyle(color: XinHeColor('#333333'),fontSize:17,fontWeight: FontWeight.w600 ),),
                  Container(width: 40,),

                ],),
            ),

            ///可提现
            Container(
              padding: const EdgeInsets.symmetric(horizontal: 15).copyWith(top: 15),
              margin: const EdgeInsets.symmetric(horizontal: 15),
              decoration: BoxDecoration(
                color: Colors.white,
                borderRadius: BorderRadius.circular(10),),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  Text('可提现',style: TextStyle(color: XinHeColor('#2B3131'),fontSize: 13,fontWeight: FontWeight.w500),),
                  SizedBox(height: 5,),
                  Text('1680.00',style: TextStyle(color: XinHeColor('#2B3131'),fontSize: 17,fontWeight: FontWeight.w500),),
                  SizedBox(height: 10,),
                  Row(
                    mainAxisSize: MainAxisSize.min,
                    children: [
                    Container(
                      height: 27,
                      width: 85,
                      alignment: Alignment.center,
                      decoration: BoxDecoration(color: XinHeColor('#03DDDD'),borderRadius: BorderRadius.circular(13.5)),
                      child: const Text('立即提现',style: TextStyle(color: Colors.white,fontSize: 12,fontWeight: FontWeight.w500),strutStyle: StrutStyle(forceStrutHeight: true),),
                    ),
                    const SizedBox(width: 10,),
                    Container(
                      height: 27,
                      width: 85,
                      alignment: Alignment.center,
                      decoration: BoxDecoration(color: XinHeColor('#CFD7D7'),borderRadius: BorderRadius.circular(13.5)),
                      child: Text('提现记录',style: TextStyle(color: XinHeColor('#9CA1A2'),fontSize: 12,fontWeight: FontWeight.w500),strutStyle: StrutStyle(forceStrutHeight: true),),
                    ),


                  ],),

                  /// 今日收益 本月收入  已提现
                  Container(
                    height: 75,
                    width: Get.width-60,
                    alignment: Alignment.center,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                      children: [

                        SizedBox(
                          width: (Get.width-60)/3.0,
                          height: 75,
                          child: Column(
                            mainAxisAlignment: MainAxisAlignment.center,
                            children: [
                              Text(state.tabList[0],style: TextStyle(color: XinHeColor('#9CA1A2'),fontSize: 12,fontWeight: FontWeight.w500),),
                              SizedBox(height: 5,),

                              Text('6000.00',style: TextStyle(color: XinHeColor('#2B3131'),fontSize: 14),),

                            ],),
                        ),


                        SizedBox(
                          width: (Get.width-60)/3.0,
                          height: 75,
                          child: Column(
                            mainAxisAlignment: MainAxisAlignment.center,
                            children: [
                              Text(state.tabList[1],style: TextStyle(color: XinHeColor('#9CA1A2'),fontSize: 12,fontWeight: FontWeight.w500),),
                              SizedBox(height: 5,),
                              Text('15',style: TextStyle(color: XinHeColor('#2B3131'),fontSize: 14),),

                            ],),
                        ),


                        SizedBox(
                          width: (Get.width-60)/3.0,
                          height: 75,
                          child: Column(
                            mainAxisAlignment: MainAxisAlignment.center,
                            children: [
                              Text(state.tabList[2],style: TextStyle(color: XinHeColor('#9CA1A2'),fontSize: 12,fontWeight: FontWeight.w500),),
                              SizedBox(height: 5,),
                              Text('60',style: TextStyle(color: XinHeColor('#2B3131'),fontSize: 14),),

                            ],),
                        ),


                      ],),
                  ),



                ],),

            ),

            const SizedBox(height: 10,),

            Expanded(
              child: Container(
                padding: const EdgeInsets.symmetric(horizontal: 15),
                margin: const EdgeInsets.symmetric(horizontal: 15),
                // height: 322,
                decoration: BoxDecoration(color: Colors.white,borderRadius: BorderRadius.circular(10)),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    SizedBox(height: 10,),
                  Text('销售商品收益',style: TextStyle(color: XinHeColor('#2B3131'),fontSize:13 ,fontWeight: FontWeight.w500),),
                  SizedBox(height: 10,),
                  Expanded(
                    child: ListView.builder(
                        padding: EdgeInsets.zero,
                        itemCount: 2,
                        itemBuilder: (ctx,index){
                          return SizedBox(height: 64,
                            child: Row(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                              children: [
                              Column(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: [
                                Text('提现单号：17896555551D',style: TextStyle(color:XinHeColor('#333333'),fontSize:13,fontWeight: FontWeight.w500  ),),
                                SizedBox(height: 10,),
                                Text('2023年6月10日  18:30',style: TextStyle(color:XinHeColor('#999999'),fontSize:11,fontWeight: FontWeight.w500  ),)

                              ],),

                                Text('+200.00',style: TextStyle(color:XinHeColor('#EB5029'),fontSize:13,fontWeight: FontWeight.w500  ),)
                            ],),
                          );
                        }
                    ),
                  )
                ],),
              ),
            )

          ],)

      ],),
    );
  }
}
